package com.ydch.spring.test.queue;

import java.util.concurrent.BlockingQueue;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

public class MessageProducterThread extends Thread {
	private static final Logger logger = LogManager.getLogger(MainAppTest.class);
	public BlockingQueue<Object> queue;  
	public void setMessage() {
		BlockingQueueMessage blockingQueueMessage = (BlockingQueueMessage) SpringUtils  
                 .getContext().getBean("blockingQueueMessage");  
         queue = blockingQueueMessage.queue;  
		for (int i = 0; i < 1000; i++) {
			logger.info("开始发送消息！---------------!"+i);
			queue.add("我发的信息!");
		}
	}
}
